1. Field of the Invention
The present invention relates to an electronic camera that performs color adjustments on a shot image as well as to a program for causing a computer to perform color adjustments.
2. Description of the Related Art
(Illumination Unevenness of a Flash)
In typical shooting with flash, an object is illuminated with complex light that is a mixture of a flash that is emitted from an electronic flash device and ambient light such as sunlight or light from street lamps. The ratio between the flash illumination and the ambient light illumination varies in a complex manner depending on the distance to the object, the angle of the object, and other factors. Therefore, the color temperature of such mixed light varies greatly depending on the position in a frame.
For example, if a human object is shot with flash and with evening sunlight as backlight, it is mainly illuminated with flash. As a result, the human object exhibits a high color temperature (e.g., 5,000 K) of the flash. On the other hand, illuminated with evening sunlight, the background exhibits a low color temperature (e.g., 3,000 K).
Such color temperature unevenness in the same frame makes it very difficult to perform proper white balance adjustments.
Japanese Unexamined Patent Application Publication No. Hei 8-051632 (hereinafter referred to as Reference 1) discloses an apparatus that performs white balance adjustments during flash shooting while dealing with the above problem.
This conventional apparatus makes preliminary shooting without flash and main shooting with flash. Then, it calculates a luminance difference on a pixel-by-pixel basis between the two shot images. A region with a large luminance difference corresponds to a portion of an object that was illuminated brightly with a flash, and exhibits a high color temperature. On the other hand, a region with a small luminance difference is less affected by the flash and exhibits a low color temperature of ambient light.
In view of the above, the conventional apparatus performs white balance adjustment for flash shooting on image regions having large luminance differences; on the contrary, it performs white balance adjustment for shooting with ambient light on image regions having small luminance differences. It performs white balance adjustment for medium light between the flash and the ambient light on regions having medium luminance differences. Thus, the conventional apparatus calculates a pixel-based luminance variation that is caused by illumination/non-illumination with a flash and judges influences of the flash on the basis of magnitudes of the luminance variation.
However, the conventional apparatus cannot obtain an image captured with flash and an image captured without flash at the same time; the two images are always generated with a time difference. If an object moves or a camera shake occurs during this interval, the shot images do not completely coincide with each other in patterns. Such pattern deviations also cause the above-described luminance differences.
Therefore, for an object that moves at high speed in a frame, it is difficult to judge influences of a flash on the basis of luminance differences between two kinds of images and it is impossible to perform proper white balance adjustments.
In other words, to avoid the problem of the conventional apparatus, the object has to be stationary or the electronic camera need be fixed to a tripod, for example. Therefore, use of the conventional apparatus leads to limiting subjects or ways of shooting.
Further, in Reference 1, to correctly measure luminance differences due to presence/absence of flash emission, it is necessary to shoot without flash and with flash under the same exposure conditions (e.g., same aperture number, same imaging sensitivity, and same charge storage time). Therefore, in flash shooting taking many seconds such as slow synchronous shooting, shooting without flash has to also be performed for many seconds. In this case a delay of a main flash shooting causes a problem of missing a good shooting chance.
In addition, since flash shooting and non-flash is started under the same exposure conditions, it is not possible to change the exposure conditions for the flash shooting halfway through the shooting. Accordingly, it is impossible to change the exposure conditions for the flash shooting in accordance with circumstances, upon analyzing a result of non-flash shooting.
(Unevenness of Illumination by Fluorescent Lamps)
It is also known that a green fog may occur in an image which is shot under illumination with fluorescent lamps because of the wavelength characteristic of the fluorescent lamps.
Japanese Unexamined Patent Application Publication No. 2003-264850 (hereinafter referred to as Reference 2) discloses a technique for correcting such a green fog by white balance adjustments as well as a technique for weakening the green fog correction if the green color of an image is judged green of a plant based on a color analysis.
If the object is illuminated with fluorescent lamps unevenly, a green fog appears only in certain portions of the object and no green fogs appear in other portions that are illuminated with strong light of another kind (e.g., light from a light bulb or a flash).
For example, consider a case that a person is positioned in front of the camera with high-rise buildings (with many fluorescent lamps seen through the windows) in the background, and he/she is illuminated with light from a light bulb, and this scene is shot with slow synchronized shooting with flash of an electronic flash device. In this case, whereas a green fog due to the fluorescent lamps covers the light coming from the high-rise buildings that account for most of the background, almost no green fog covers a region in which the person stands in front of the camera because he/she is illuminated brightly with the light bulb or flash.
With a conventional green fog correction for such an image, a problem arises that an unnatural magenta fog occurs in the image region including the person which is free from the green fog, because the levels of red and blue components of the image region increase.
Heretofore, it has been impossible for an electronic camera to solve this problem automatically by image processing because it cannot judge properly whether green fogs occur in the entire image or only parts of it. That is because by the conventional technique color fogs are detected merely in limited regions of an image such as low-chroma regions. Therefore, it cannot be judged whether detected green fogs cover the entire image.